<?php $month ='';?>
<?php foreach ($profit->result() as $key => $val ): ?>
<li>
    <?php if (date("Y-m",$val->ordertime) != $month) : ?>
        <div class="list-time">
            <?php $month = date("Y-m",$val->ordertime); ?>
            <?php echo date("Y-m-d",$val->ordertime); ?>
        </div>
    <?php endif; ?>
    <div class="usermsg-box">
        <div class="usermsg flex">
            <div class="user flex-1"><?php echo $val->payer_name;?></div>
            <div class="ordertime flex-1"><?php echo date("Y-m-d h:i",$val->ordertime);?> &nbsp;下单</div>
        </div>
        <div class="title am-cf">
            <div class="name"><?php echo $val->goods_name;?></div>
            <div class="type2"><?php echo $cat_name[$val->cat_id]; ?></div>
            <div class="price">￥<?php echo $val->price;?></div>
        </div>
        <div class="tradstate am-cf">
            <span class="trad-num"><?php echo $val->number;?>份</span>
        </div>
        <div class="orderprice">订单金额：￥<?php echo $val->amount_total;?></div>
        <div class="fprice am-cf">
            <?php if ($val->bit_use > 0): ?>
                <span class="hasprice am-fl">已到账</span>
            <?php else:?>
                <span class="notprice am-fl">未到账</span>
            <?php endif ?>
            <span>分润金额：</span>
            <span <?php if ($val->bit_use > 0): ?>class="hasprice"<?php else:?>class="notprice"<?php endif ?> >
                ￥<?php echo $val->amount;?>
            </span>
        </div>
    </div>
</li>
<?php endforeach ?>
